'use strict';

/**
 * @ngdoc function
 * @name generatorApp.controller:MainCtrl
 * @description
 * # MainCtrl
 * Controller of the generatorApp
 */
angular.module('generatorApp')
  .controller('MainCtrl',function($scope,$interval){
        $scope.ProgressValue={
            label:0,
            percentage:0.00
        };
        $scope.$watch('ProgressValue',function(newValue){
            newValue.percentage=newValue.label/100;
        },true);
        $scope.i=0;
        $scope.timer=$interval(function(){
            $scope.i++;
            $scope.ProgressValue.label=$scope.i;
            if($scope.i === 100){
                $interval.cancel($scope.timer);
            }
        },500)
    });
